package com.itheima.web;

import com.itheima.entity.Result;

import com.itheima.service.SetmealService;

import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Random;

/**
 * company: www.abc.com
 * Author: 29746
 * Create Data: 2020/11/16
 */
@RestController
@RequestMapping("/setmeal")
public class SetmealController {

    @Reference
    private SetmealService setmealService;

    @GetMapping("/findAllSetmeal")
    @ApiOperation("查询所有套餐") //逻辑删除后修改的查询方法
    public Result findAll(){
        return new Result(setmealService.findAll());
    }

    @GetMapping("/findSetmealVo/{setmealId}")
    public Result findSetmealVo(@PathVariable("setmealId") Long setmealId){
        return new Result(setmealService.findSetmealVo(setmealId));
    }



}
